<template>
	<div>
		<div class="banner" @click="handleClickBanner">
			<img class="banner-img"  :src="bannerImg">
			<div class="banner-info">
				<div class="banner-title">{{this.sightName}}</div>
				<div class="banner-number"><span class="iconfont icon-tupian"></span>  {{this.bannerImgs.length}}</div>
			</div>
		</div>
		<fade-animate>
			<gallary v-show="showGallary" @close="handleClickClose" :imgs="bannerImgs"></gallary>
		</fade-animate>
	</div>
</template>

<script>
import Gallary from '@/common/components/Gallary.vue'
import FadeAnimate from '@/common/fade/FadeAnimate.vue'
export default {
	name: 'DetailBanner',
	components: {
		Gallary,
		FadeAnimate
	},
	props: {
		sightName: String,
		bannerImg: String,
		bannerImgs: Array
	},
	data () {
		return {
			showGallary: false
		}
	},
	methods: {
		handleClickBanner () {
			this.showGallary = true
		},
		handleClickClose () {
			this.showGallary = false
		}
	}
}
</script>

<style lang="stylus" scoped="">
.banner
	position: relative
	height: 0
	padding-bottom: 55%
	.banner-img
		width: 100%
	.banner-info
		position: absolute
		display:flex
		left: 0
		right: 0
		bottom: 0 
		height: .5rem
		line-height: .5rem
		background: linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.8))
		color: #fff
		padding: .2rem
		.banner-title
			flex: 1
		.banner-number
			width:1.2rem
			background: rgba(0,0,0,0.6)
			border-radius:6rem
			text-align: center
			
</style>